<?php

class RemoteCatalogue {
	
	var $url;
	var $catalogue_id;
	
	public function __construct($url, $catalogue_id) {
		$this->url = $url;
		$this->catalogue_id = $catalogue_id;
	}
	
	public function getChildrenByNode($node) {
		try {
			$cont = file_get_contents($this->url."?cid=".$this->catalogue_id.":".$node);
			$result = unserialize($cont);
			if (!$result || $result["name"]!="catalogue") throw new Exception("Error");
			return $result["result"];
		} catch (Exception $e) {
			return array();
		}
	}
}
?>